package com.example.springboot_springsecurity_jwt_redis.controller;

import com.example.springboot_springsecurity_jwt_redis.pojo.Blog;
import com.example.springboot_springsecurity_jwt_redis.service.BlogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
//@RequestMapping("/admin")
public class BlogController {

    @Autowired
    private BlogService blogService;

//    @CrossOrigin
    @ApiOperation("查询博客列表信息")
//    @PreAuthorize("hasRole('ADMIN')")
    @GetMapping("/selectBlogInfo")
    public List<Blog> selectBlogInfo() {
        return blogService.selectPageBlogInfo();
    }
}
